package thread;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.PriorityBlockingQueue;

public class testDemo21 {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<Integer> queue=new ArrayBlockingQueue<>(4);
        BlockingQueue<Integer> queue1=new LinkedBlockingQueue<>(4);
        BlockingQueue<Integer> queue2=new PriorityBlockingQueue<>(4);
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        System.out.println(queue.take());
        System.out.println(queue.take());

    }
}
